﻿@model ArbabTravelsERP.Models.CandidateModel
@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@using (Html.BeginForm("Create", "Employee", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @id = "formControl", @class = "form-horizontal", enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()

            <!-- page content -->
            <div class="right_col" role="main">
                <div class="">
                    <div class="page-title">
                        <div class="title_left">
                            <h3>Employee</h3>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                    <div class="row">
                        <div class="col-md-12 col-sm-12 col-xs-12">
                            <div class="x_panel">
                                <div class="x_title">
                                    <h2>Add Employee Details</h2>
                                    <div class="clearfix"></div>
                                </div>


                                <div class="x_content">
                                    @if (@TempData["Success"] != null)
                                    {
                                    <div class="alert alert-success alert-dismissable">
                                        <button type="button" class="close" data-dismiss="alert"
                                                aria-hidden="true">
                                            &times;
                                        </button>
                                        @TempData["Success"]
                                    </div>
                                    }

                                    @if (@TempData["Error"] != null)
                                    {
                                    <div class="alert alert-dismissable">
                                        <button type="button" class="close" data-dismiss="alert"
                                                aria-hidden="true">
                                            &times;
                                        </button>
                                        @ViewData["Error"]
                                    </div>
                                    }


                                    <!-- Tabs -->
                                    <br />

                                    <!-- Smart Wizard -->
                                    <div id="wizard" class="form_wizard wizard_horizontal">
                                        <ul class="wizard_steps">
                                            <li>
                                                <a href="#step-1">
                                                    <span class="step_no">1</span>
                                                    <span class="step_descr">
                                                        Step 1<br />
                                                        <small>Official Details</small>
                                                    </span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#step-2">
                                                    <span class="step_no">2</span>
                                                    <span class="step_descr">
                                                        Step 2<br />
                                                        <small>Personal Details</small>
                                                    </span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#step-3">
                                                    <span class="step_no">3</span>
                                                    <span class="step_descr">
                                                        Step 3<br />
                                                        <small>Contact Details</small>
                                                    </span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#step-4">
                                                    <span class="step_no">4</span>
                                                    <span class="step_descr">
                                                        Step 4<br />
                                                        <small>Education Details</small>
                                                    </span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#step-5">
                                                    <span class="step_no">5</span>
                                                    <span class="step_descr">
                                                        Step 5<br />
                                                        <small>Work Experience Details</small>
                                                    </span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#step-6">
                                                    <span class="step_no">6</span>
                                                    <span class="step_descr">
                                                        Step 6<br />
                                                        <small>Upload Documents</small>
                                                    </span>
                                                </a>
                                            </li>
                                        </ul>
                                        <div id="step-1">
                                            <h2 class="StepTitle">Step 1 Official Details</h2>
                                            <div id="candidateForm1" data-parsley-validate class="form-horizontal form-label-left">
                                                <div class="form-group">
                                                    <label class="control-label col-md-3 col-sm-3" for="requirementNo">Registration No <span class="required">*</span> </label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextBoxFor(model => model.REGISTRATION_NO, new { @id = "REGISTRATION_NO", @class = "form-control  col-md-7 col-xs-12", @autocomplete = "off", @maxlength = "20", @readonly = "readonly" })
                                                        @Html.ValidationMessageFor(model => model.REGISTRATION_NO, "", new { @class = "text-danger" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-3 col-sm-3">Branch <span class="required">*</span></label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.DropDownListFor(model => model.BRANCH_CODE, ViewData["GetBranch"] as SelectList, "Select Branch", new { @id = "AVAILING_TYPE_ID", @class = "form-control", @autocomplete = "off" })
                                                        @Html.ValidationMessageFor(model => model.BRANCH_CODE, "", new { @class = "text-danger" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-3 col-sm-3">Source <span class="required">*</span></label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.DropDownListFor(model => model.SOURCE_ID, ViewData["GetSource"] as SelectList, "Select Source", new { @id = "SOURCE_ID", @class = "form-control", @autocomplete = "off" })
                                                        @Html.ValidationMessageFor(model => model.SOURCE_ID, "", new { @class = "text-danger" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-3 col-sm-3">Status </label>
                                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                                        @Html.DropDownListFor(model => model.STATUS_ID, ViewData["GetStatus"] as SelectList, "Select Status", new { @id = "STATUS_ID", @class = "form-control", @autocomplete = "off" })
                                                        @Html.ValidationMessageFor(model => model.STATUS_ID, "", new { @class = "text-danger" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-3 col-sm-3">Login Access </label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @{
                                                        List<SelectListItem>
                                                            listLoginAccess = new List<SelectListItem>
                                                                ();
                                                                listLoginAccess.Add(new SelectListItem
                                                                {
                                                                Text = "Yes",
                                                                Value = "Yes"
                                                                });
                                                                listLoginAccess.Add(new SelectListItem
                                                                {
                                                                Text = "No",
                                                                Value = "No"
                                                                });
                                                                }
                                                                @Html.DropDownListFor(model => model.LOGIN_ACCESS, listLoginAccess, "--Select Login Access--", new { @id = "LOGIN_ACCESS", @class = "form-control", @autocomplete = "off" })
                                                    </div>

                                                </div>
                                            </div>

                                        </div>
                                        <div id="step-2">
                                            <h2 class="StepTitle">Step 2 Personal Details</h2>
                                            <div class="col-md-12" style="margin-top:10px">
                                                <div class="col-md-9">
                                                    <div id="candidateForm2" data-parsley-validate class="form-horizontal form-label-left">
                                                        <div class="form-group">
                                                            <label for="middle-name" class="control-label col-md-4 col-sm-4">Full Name  <span class="required">*</span></label>
                                                            <div class="col-md-3 col-sm-3">
                                                                @Html.TextBoxFor(model => model.FIRST_NAME, new { @id = "FIRST_NAME", @class = "form-control col-md-7 col-xs-12", @placeholder = "First Name", @autocomplete = "off", @maxlength = "50" })
                                                                @Html.ValidationMessageFor(model => model.FIRST_NAME, "", new { @class = "text-danger" })
                                                            </div>
                                                            <div class="col-md-2 col-sm-2">
                                                                @Html.TextBoxFor(model => model.MIDDLE_NAME, new { @id = "MIDDLE_NAME", @class = "form-control col-md-7 col-xs-12", @placeholder = "Middle Name", @autocomplete = "off", @maxlength = "50" })
                                                            </div>
                                                            <div class="col-md-3 col-sm-3">
                                                                @Html.TextBoxFor(model => model.LAST_NAME, new { @id = "LAST_NAME", @class = "form-control col-md-7 col-xs-12", @placeholder = "Last Name", @autocomplete = "off", @maxlength = "50" })
                                                                @Html.ValidationMessageFor(model => model.LAST_NAME, "", new { @class = "text-danger" })
                                                            </div>


                                                        </div>
                                                        <div class="form-group">
                                                            <label for="middle-name" class="control-label col-md-4 col-sm-4">Father Name</label>
                                                            <div class="col-md-8 col-sm-8">
                                                                @Html.TextBoxFor(model => model.FATHER_NAME, new { @id = "FATHER_NAME", @class = "form-control col-md-7 col-xs-12", @placeholder = "Father Name", @autocomplete = "off", @maxlength = "80" })
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label for="middle-name" class="control-label col-md-4 col-sm-4">Mother Name</label>
                                                            <div class="col-md-8 col-sm-8">
                                                                @Html.TextBoxFor(model => model.MOTHER_NAME, new { @id = "MOTHER_NAME", @class = "form-control col-md-7 col-xs-12", @placeholder = "Mother Name", @autocomplete = "off", @maxlength = "80" })
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-4 col-sm-4">Gender <span class="required">*</span>  </label>
                                                            <div class="col-md-6 col-sm-6">
                                                                @{
                                                                List<SelectListItem>
                                                                    listGender = new List<SelectListItem>
                                                                        ();
                                                                        listGender.Add(new SelectListItem
                                                                        {
                                                                        Text = "Male",
                                                                        Value = "Male"
                                                                        });
                                                                        listGender.Add(new SelectListItem
                                                                        {
                                                                        Text = "Female",
                                                                        Value = "Female"
                                                                        });
                                                                        }
                                                                        @Html.DropDownListFor(model => model.GENDER_CODE, listGender, "--Select Gender--", new { @id = "GENDER_CODE", @class = "form-control", @autocomplete = "off" })
                                                            </div>
                                                            @*<div class="col-md-8 col-sm-8 col-xs-12">
                                                                <div class="btn-group" data-toggle="buttons">
                                                                    <label class="btn btn-default active">
                                                                        <input type="radio" name="gender" id="male" value="male" checked="checked">
                                                                        Male
                                                                    </label>
                                                                    <label class="btn btn-default">
                                                                        <input type="radio" name="gender" id="female" value="female">
                                                                        Female
                                                                    </label>
                                                                    @Html.HiddenFor(model => model.GENDER_CODE)
                                                                </div>
                                                            </div>*@
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-4 col-sm-4" for="contactPerson">Date of Birth <span class="required">*</span> </label>
                                                            <div class="col-md-8 col-sm-8">
                                                                @Html.TextBoxFor(model => model.DATE_OF_BIRTH, new { @id = "DATE_OF_BIRTH", @class = "form-control", @placeholder = "Date of Birth", @autocomplete = "off", @maxlength = "20" })
                                                                @Html.ValidationMessageFor(model => model.DATE_OF_BIRTH, "", new { @class = "text-danger" })
                                                                <span id="textBoxName"></span>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-4 col-sm-4">Place of Birth </label>
                                                            <div class="col-md-8 col-sm-8">
                                                                @Html.TextBoxFor(model => model.PLACE_OF_BIRTH, new { @id = "PLACE_OF_BIRTH", @class = "form-control", @placeholder = "Place of Birth", @autocomplete = "off", @maxlength = "50" })

                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-4 col-sm-4">Martial Status</label>
                                                            <div class="col-md-8 col-sm-8">
                                                                @Html.DropDownListFor(model => model.MARITAL_STATUS_ID, ViewData["GetMaritalStatus"] as SelectList, "Select Marital Status", new { @id = "MARITAL_STATUS_ID", @class = "form-control", @autocomplete = "off" })

                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-4 col-sm-4">Nationality <span class="required">*</span></label>
                                                            <div class="col-md-8 col-sm-8">
                                                                @Html.DropDownListFor(model => model.NATIONALITY_ID, ViewData["GetNationality"] as SelectList, "Select Nationality", new { @id = "NATIONALITY_ID", @class = "form-control", @autocomplete = "off" })
                                                                @Html.ValidationMessageFor(model => model.NATIONALITY_ID, "", new { @class = "text-danger" })
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-4 col-sm-4">Current Location <span class="required">*</span></label>
                                                            <div class="col-md-8 col-sm-8">
                                                                @Html.DropDownListFor(model => model.CURRENT_LOCATION, ViewData["GetLocation"] as SelectList, "Select Current Location", new { @id = "CURRENT_LOCATION", @class = "form-control", @autocomplete = "off" })
                                                                @Html.ValidationMessageFor(model => model.CURRENT_LOCATION, "", new { @class = "text-danger" })
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="control-label col-md-4 col-sm-4">Religion<span class="required">*</span></label>
                                                            <div class="col-md-8 col-sm-8">
                                                                @Html.DropDownListFor(model => model.RELIGION_ID, ViewData["GetReligion"] as SelectList, "Select Religion", new { @id = "RELIGION_ID", @class = "form-control", @autocomplete = "off" })
                                                                @Html.ValidationMessageFor(model => model.RELIGION_ID, "", new { @class = "text-danger" })
                                                            </div>
                                                        </div>


                                                    </div>
                                                </div>
                                                <div class="col-md-3">

                                                    <div class="fileinput fileinput-new" data-provides="fileinput">
                                                        <div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;"></div>
                                                        <div>
                                                            <span class="btn btn-default btn-file"><span class="fileinput-new">Select image</span><span class="fileinput-exists">Change</span><input type="file" name="..." id="SaveImage"></span>
                                                            <a href="#" class="btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
                                                            @Html.HiddenFor(model => model.USER_IMAGE_PATH)
                                                        </div>

                                                    </div>
                                                </div>
                                            </div>

                                        </div>


                                        <div id="step-3">
                                            <h2 class="StepTitle">Step 3 Contact Details</h2>
                                            <div id="candidateForm3" class="form-horizontal form-label-left">
                                                <div class="groupAddress">
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3" for="contactPerson">
                                                            Address <span class="required">*</span>
                                                        </label>
                                                        <div class="col-md-2 col-sm-2">
                                                            @Html.DropDownListFor(model => model.ADDRESS_TYPE_ID, ViewData["GetAddressType"] as SelectList, "Select Address Type", new { @id = "ADDRESS_TYPE_ID", @class = "form-control", @autocomplete = "off" })

                                                        </div>
                                                        <div class="col-md-4 col-sm-4">
                                                            @Html.TextBoxFor(model => model.ADDRESS, new { @id = "ADDRESS", @class = " form-control", @placeholder = "Address", @autocomplete = "off" })
                                                        </div>
                                                        <div class="">
                                                            <button type="button" class="addAddress addButton" id="SaveAddress"><i class="fa fa-plus"></i></button>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <div class="col-xs-offset-3 col-md-3 col-sm-3">
                                                            @Html.DropDownListFor(model => model.COUNTRY_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select Country", new { @id = "COUNTRY_CODE", @class = "form-control", @autocomplete = "off" })

                                                        </div>
                                                        <div class="col-md-3 col-sm-3">
                                                            @Html.DropDownListFor(model => model.STATE_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select State", new { @id = "STATE_CODE", @class = "form-control", @autocomplete = "off" })

                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <div class="col-xs-offset-3 col-md-3 col-sm-3">
                                                            @Html.DropDownListFor(model => model.CITY_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select City", new { @id = "CITY_CODE", @class = "form-control", @autocomplete = "off" })

                                                        </div>
                                                        <div class="col-md-3 col-sm-3">
                                                            @Html.TextBoxFor(model => model.VILLAGE, new { @id = "VILLAGE", @class = "form-control col-md-7 col-xs-12", @placeholder = "Village", @autocomplete = "off", @maxlength = "20" })

                                                        </div>
                                                    </div>

                                                    <div class="form-group">
                                                        <label for="middle-name" class="control-label col-md-3 col-sm-3">Pin Code</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.TextBoxFor(model => model.PIN_CODE, new { @id = "PIN_CODE", @class = " form-control", @placeholder = "Pin Code", @autocomplete = "off", @maxlength = "6", @onkeypress = "return isNumberKey(event)" })
                                                        </div>
                                                    </div>

                                                    <table class="table  table-bordered table-responsive table-striped" id="tblchild"></table>
                                                </div>


                                                <div class="form-group">
                                                    <label for="middle-name" class="control-label col-md-3 col-sm-3">Email Address</label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextBoxFor(model => model.EMAIL_ID, new { @id = "EMAIL_ID", @class = " form-control col-md-7 col-xs-12", @placeholder = "Email ID", @autocomplete = "off" })

                                                        <span class="fa fa-envelope-o form-control-feedback right" aria-hidden="true"></span>
                                                    </div>
                                                    <div class="col-xs-1">
                                                        <button type="button" class="addButton addEmailButton" id="SaveEmail"><i class="fa fa-plus"></i></button>
                                                    </div>
                                                </div>
                                                <table class="table  table-bordered table-responsive table-striped form-group-sm" id="tblemail"></table>

                                                <div class="form-group">
                                                    <label for="middle-name" class="control-label col-md-3 col-sm-3">Phone Number <span class="required">*</span></label>
                                                    <div class="col-md-2 col-sm-2">
                                                        @Html.DropDownListFor(model => model.PHONE_TYPE_ID, ViewData["GetAddressType"] as SelectList, new { @id = "PHONE_TYPE_ID", @class = "form-control", @autocomplete = "off" })

                                                    </div>
                                                    <div class="col-md-4 col-sm-4">
                                                        @Html.TextBoxFor(model => model.PHONE_NO, new { @id = "PHONE_NO", @class = " form-control col-md-7 col-xs-12", @placeholder = "Phone No", @autocomplete = "off", @maxlength = "11", @onkeypress = "return isNumberKey(event)" })
                                                        <span class="fa fa-phone form-control-feedback right" aria-hidden="true"></span>
                                                    </div>
                                                    <div class="col-xs-1">
                                                        <button type="button" class="addButton addPhoneButton" id="SavePhone"><i class="fa fa-plus"></i></button>
                                                    </div>
                                                </div>
                                                <table class="table  table-bordered table-responsive table-striped form-group-sm" id="tblphone"></table>

                                                <div class="form-group">
                                                    <label for="middle-name" class="control-label col-md-3 col-sm-3">Website</label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextBoxFor(model => model.WEBSITE, new { @id = "WEBSITE", @class = " form-control col-md-7 col-xs-12", @placeholder = "Website", @autocomplete = "off" })

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label for="middle-name" class="control-label col-md-3 col-sm-3">Skype</label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextBoxFor(model => model.SKYPE, new { @id = "SKYPE", @class = " form-control col-md-7 col-xs-12", @placeholder = "Skype", @autocomplete = "off" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-3 col-sm-3">Remark</label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextAreaFor(model => model.CONTACT_REMARK, new { @id = "CONTACT_REMARK", @class = " form-control col-md-7 col-xs-12", @placeholder = "Remark", @autocomplete = "off" })
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div id="step-4">
                                            <h2 class="StepTitle">Step 4 Educational Details</h2>
                                            <div id="candidateForm4" data-parsley-validate class="form-horizontal form-label-left">
                                                <div class="groupAddress">
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3" for="Education">Education</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.DropDownListFor(model => model.EDUCATION_TYPE_ID, ViewData["GetEducation"] as SelectList, "Select Education", new { @id = "EDUCATION_TYPE_ID", @class = "form-control", @autocomplete = "off" })
                                                        </div>
                                                        <div class="">
                                                            <button type="button" class="addAddress addButton" id="SaveEducation"><i class="fa fa-plus"></i></button>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3" for="Specialization">Specialization</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.DropDownListFor(model => model.SPECIALIZATION_TYPE_ID, ViewData["GetSpecialization"] as SelectList, "Select Specialization", new { @id = "SPECIALIZATION_TYPE_ID", @class = "form-control", @autocomplete = "off" })
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3" for="University">University</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.DropDownListFor(model => model.UNIVERSITY_ID, ViewData["GetUniversity"] as SelectList, "Select University", new { @id = "UNIVERSITY_ID", @class = "form-control", @autocomplete = "off" })
                                                        </div>
                                                    </div>

                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3" for="Passing">Year of Passing</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.TextBoxFor(model => model.UNIVERSITY_YEAR_OF_PASSING, new { @id = "UNIVERSITY_YEAR_OF_PASSING", @class = " form-control col-md-7 col-xs-12", @placeholder = "Year of Passing", @autocomplete = "off", @maxlength = "4", @onkeypress = "return isNumberKey(event)" })
                                                        </div>
                                                    </div>
                                                    <table class="table  table-bordered table-responsive table-striped" id="tbleducation"></table>
                                                </div>

                                                <div class="groupCertification">
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3" for="Certification">Certification</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.TextBoxFor(model => model.CERTIFICATION, new { @id = "CERTIFICATION", @class = " form-control col-md-10 auto-custom", @style = "float: left;", @placeholder = "Certification", @autocomplete = "off" })

                                                            <div class="" id="autocomplete-container" style="position: relative; float: left; width: 400px;"></div>
                                                        </div>
                                                        <div class="">
                                                            <button type="button" class="addCertification addButton" id="SaveCertification"><i class="fa fa-plus"></i></button>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3" for="Level">Level</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.TextBoxFor(model => model.CERTIFICATION_LEVEL, new { @id = "CERTIFICATION_LEVEL", @class = " form-control col-md-7 col-xs-12", @style = "float: left;", @placeholder = "CERTIFICATION_LEVEL", @autocomplete = "off" })

                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3" for="Insititue">Insititue</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.TextBoxFor(model => model.INSTITUTE_NAME, new { @id = "INSTITUTE_NAME", @class = " form-control col-md-7 col-xs-12", @style = "float: left;", @placeholder = "Institute Name", @autocomplete = "off" })

                                                        </div>
                                                    </div>

                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3" for="Passing">Year of Passing</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.TextBoxFor(model => model.INSTITUE_YEAR_OF_PASSIN, new { @id = "INSTITUE_YEAR_OF_PASSIN", @class = "date-picker form-control col-md-7 col-xs-12", @style = "float: left;", @placeholder = "Year of Passing", @autocomplete = "off", @maxlength = "4", @onkeypress = "return isNumberKey(event)" })

                                                        </div>
                                                    </div>
                                                    <table class="table  table-bordered table-responsive table-striped" id="tblcertification"></table>
                                                </div>


                                                <div class="form-group">
                                                    <label class="control-label col-md-3 col-sm-3">Remark</label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextBoxFor(model => model.EDUCATIONAL_REMARK, new { @id = "EDUCATIONAL_REMARK", @class = "date-picker form-control col-md-7 col-xs-12", @placeholder = "Remark", @autocomplete = "off" })

                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div id="step-5">
                                            <h2 class="StepTitle">Step 5 Work Experience Details</h2>
                                            <div id="candidateForm5" data-parsley-validate class="form-horizontal form-label-left">
                                                <div class="form-group">
                                                    <label class="control-label col-md-3 col-sm-3">Career Status</label>
                                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                                        <div class="btn-group" data-toggle="buttons" id="isExp">
                                                            <label class="btn btn-default active">

                                                                <input type="radio" name="careerstatus" id="Experience" value="Experience" checked="checked">
                                                                Experienced
                                                            </label>
                                                            <label class="btn btn-default">
                                                                <input type="radio" name="careerstatus" id="Fresher" value="Fresher">
                                                                Fresher
                                                            </label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="groupCompany career">
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3">Company Name</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.DropDownListFor(model => model.USER_COMPANY_NAME, ViewData["GetCompany"] as SelectList, "Select Company", new { @id = "USER_COMPANY_NAME", @class = "form-control", @autocomplete = "off" })

                                                        </div>
                                                        <div class="col-xs-1">
                                                            <button type="button" class="addButton addCompany" id="SaveWork"><i class="fa fa-plus"></i></button>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3">Currently Working</label>
                                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                                            <div class="btn-group" data-toggle="buttons">
                                                                <label class="btn btn-default active">
                                                                    <input type="radio" name="currentlyworking" id="WorkNo" value="No" checked="checked">
                                                                    No
                                                                </label>
                                                                <label class="btn btn-default">
                                                                    <input type="radio" name="currentlyworking" id="WorkYes" value="Yes">
                                                                    Yes
                                                                </label>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3">Designation</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.DropDownListFor(model => model.DESIGNATION_ID, ViewData["GetDesignation"] as SelectList, "Select Designation", new { @id = "DESIGNATION_ID", @class = "form-control", @autocomplete = "off" })

                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3">Industry</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.DropDownListFor(model => model.INDUSTRY_ID, ViewData["GetIndustry"] as SelectList, "Select Industry", new { @id = "INDUSTRY_ID", @class = "form-control", @autocomplete = "off" })
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3" for="contactperson">Work Period</label>
                                                        <div class="col-md-3 col-sm-3 datepicker" id="datepicker" data-date-format="dd/MM/yyyy">
                                                            @Html.TextBoxFor(model => model.WORK_PERIOD_FROM, new { @id = "WORK_PERIOD_FROM", @class = "date-picker form-control col-md-7 col-xs-12", @placeholder = "Period From", @autocomplete = "off" })

                                                            <span class="fa fa-calendar-o form-control-feedback right" aria-hidden="true"></span>
                                                        </div>
                                                        <div class="col-md-3 col-sm-3 datepicker" id="datepicker" data-date-format="dd/MM/yyyy">
                                                            @Html.TextBoxFor(model => model.WORK_PERIOD_TO, new { @id = "WORK_PERIOD_TO", @class = "date-picker form-control col-md-7 col-xs-12", @placeholder = "Period To", @autocomplete = "off" })

                                                            <span class="fa fa-calendar-o form-control-feedback right" aria-hidden="true"></span>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3">Country</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.DropDownListFor(model => model.WORK_EXP_COUNTRY_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select Country", new { @id = "WORK_EXP_COUNTRY_CODE", @class = "form-control", @autocomplete = "off" })

                                                        </div>

                                                    </div>

                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3">State</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.DropDownListFor(model => model.WORK_EXP_STATE_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select State", new { @id = "WORK_EXP_STATE_CODE", @class = "form-control", @autocomplete = "off" })

                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-md-3 col-sm-3">City</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.DropDownListFor(model => model.WORK_EXP_CITY_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select City", new { @id = "WORK_EXP_CITY_CODE", @class = "form-control", @autocomplete = "off" })

                                                        </div>
                                                    </div>
                                                    <table class="table  table-bordered table-responsive table-striped form-group-sm" id="tblwork"></table>
                                                </div>


                                                <div class="form-group career ">
                                                    <label class="control-label col-md-3 col-sm-3">Total Work Experience</label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextBoxFor(model => model.TOTAL_WORK_EXPERIENCE, new { @id = "TOTAL_WORK_EXPERIENCE", @class = "form-control", @placeholder = "Total Work Experience", @autocomplete = "off" })
                                                    </div>
                                                </div>


                                                <div class="form-group career">
                                                    <label class="control-label col-md-3 col-sm-3">Total Gulf Experience</label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextBoxFor(model => model.TOTAL_GULF_EXPERIENCE, new { @id = "TOTAL_GULF_EXPERIENCE", @class = "form-control", @placeholder = "Total Gulf Experiemce", @autocomplete = "off" })
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    <label class="control-label col-md-3 col-sm-3">Skills</label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextBoxFor(model => model.SKILLS, new { @id = "SKILLS", @class = "form-control", @placeholder = "Skills", @autocomplete = "off" })

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-3 col-sm-3">Remark</label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextAreaFor(model => model.EXP_REMARK, new { @id = "EXP_REMARK", @class = "form-control", @placeholder = "Remark", @autocomplete = "off" })

                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                        <div id="step-6">
                                            <h2 class="StepTitle">Step 6 Upload Documents</h2>
                                            <div id="candidateForm6" data-parsley-validate class="form-horizontal form-label-left">
                                                <div class="groupDocuments">
                                                    <div class="form-group">
                                                        <label class="control-label col-md-4 col-sm-4">Document Type </label>
                                                        <div class="col-md-6 col-sm-6">
                                                            @Html.TextBoxFor(model => model.DOCUMENT_TYPE_ID, new { @id = "DOCUMENT_TYPE_ID", @class = "form-control col-md-10 document-custom", @style = "float: left;", @placeholder = "Document Type", @autocomplete = "off" })
                                                            <div class="" id="document-container" style="position: relative; float: left; width: 400px;"></div>
                                                        </div>

                                                        <div class="">
                                                            <button type="button" class="addDocuments addButton" id="SaveDoc"><i class="fa fa-plus"></i></button>
                                                        </div>
                                                    </div>

                                                    <div class="form-group">
                                                        <label class="control-label col-md-4 col-sm-4">Attach Document</label>
                                                        <div class="col-md-6 col-sm-6">
                                                            <div class="fileinput fileinput-new" data-provides="fileinput">
                                                                <span class="btn btn-default btn-file" style="margin-left:0px;"><span class="fileinput-new">Select file</span><span class="fileinput-exists">Change</span><input type="file" name="..." id="DOCUMENT_PATH"></span>
                                                                <span class="fileinput-filename"></span>
                                                                <a href="#" class="close fileinput-exists" data-dismiss="fileinput" style="float: none">&times;</a>
                                                            </div>

                                                        </div>
                                                    </div>
                                                    <table class="table  table-bordered table-responsive table-striped form-group-sm" id="tbldoc"></table>
                                                </div>

                                            </div>
                                        </div>
                                    </div>

                                    <!-- End SmartWizard Content -->
                                    @Html.ValidationSummary(false, "", new { @class = "text-danger" })


                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- footer content -->
                <footer>
                    <div class="">
                        <!--p class="pull-right">Gentelella Alela! a Bootstrap 3 template by <a>Kimlabs</a>. |
                                              <span class="lead"> <i class="fa fa-paw"></i> Gentelella Alela!</span>
                                          </p-->
                    </div>
                    <div class="clearfix"></div>
                </footer>
                <!-- /footer content -->

            </div>
            <!-- /page content -->
    
    }
    <div id="custom_notifications" class="custom-notifications dsp_none">
        <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group"></ul>
        <div class="clearfix"></div>
        <div id="notif-group" class="tabbed_notifications"></div>
    </div>

    <script type="text/javascript" src="~/js/bootstrapValidator.js"></script>
    <!-- bootstrap progress js -->
    <script src="~/js/progressbar/bootstrap-progressbar.min.js"></script>
    <script src="~/js/nicescroll/jquery.nicescroll.min.js"></script>
    <!-- icheck -->
    <script src="~/js/icheck/icheck.min.js"></script>
    <!-- range slider -->
    <script src="~/js/ion_range/ion.rangeSlider.min.js"></script>
    <!-- input mask -->
    <script src="~/js/input_mask/jquery.inputmask.js"></script>
    <script src="~/js/custom.js"></script>
    <!-- form wizard -->
    <script type="text/javascript" src="~/js/wizard/jquery.smartWizard.js"></script>
    <!-- select2 -->
    <script src="~/js/select/select2.full.js"></script>
    <!-- tags -->
    <script src="~/js/tags/jquery.tagsinput.min.js"></script>
    <!-- Multiselect -->
    <script type="text/javascript" src="~/js/prettify.js"></script>
    <script type="text/javascript" src="~/js/bootstrap-multiselect.js"></script>
    <!-- Datatables -->
    <script src="~/js/datatables/js/jquery.dataTables.js"></script>
    <script src="~/js/datatables/tools/js/dataTables.tableTools.js"></script>
    <!--file input-->
    <script src="~/js/jasny-bootstrap/jasny-bootstrap.min.js"></script>
    <script src="~/Scripts/bootstrap-datepicker.js"></script>
    <link href="~/Content/bootstrap-datepicker.css" rel="stylesheet" />
    <script src="~/js/mask.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $("#SaveImage").change(function (e) {
                debugger;
                var imagepath = $("#SaveImage").val();
                $("#USER_IMAGE_PATH").val(imagepath);
            });
        });
    </script>

    <script type="text/javascript">
            $(document).ready(function () {
                var regno = '@ViewData["RegNo"]';
                $("#REGISTRATION_NO").val(regno);

            });
    </script>

    <script type="text/jscript">
        //get file size
        function GetFileSize(fileid) {
            try {
                var fileSize = 0;
                //for FF, Safari, Opeara and Others
                fileSize = $("#" + fileid)[0].files[0].size //size in kb
                fileSize = fileSize / 1048576; //size in mb
                return fileSize;
            }
            catch (e) {
                alert("Error is :" + e);
            }
        }

        //get file path from client system
        function getNameFromPath(strFilepath) {
            var objRE = new RegExp(/([^\/\\]+)$/);
            var strName = objRE.exec(strFilepath);

            if (strName == null) {
                return null;
            }
            else {
                return strName[0];
            }
        }

        function checkfile() {
            var file = getNameFromPath($("#DOCUMENT_PATH").val());
            if (file != null) {
                var extension = file.substr((file.lastIndexOf('.') + 1));
                // alert(extension);
                switch (extension) {
                    case 'doc':
                        //case 'xlsx':
                        flag = true;
                        break;
                    default:
                        flag = false;
                }
            }
            if (flag == false) {
                $("#DOCUMENT_PATH").val('');
                alert("You can upload only doc extension file");
                return false;
            }
            else {
                if (file != null) {
                    var maxfilesize = 3;

                    var size = GetFileSize('DOCUMENT_PATH');
                    if (size > maxfilesize) {
                        alert("You can upload file up to " + maxfilesize + " MB");
                        return false;
                    }
                }
            }
        }

        $(function () {
            $("#DOCUMENT_PATH").change(function () {
                checkfile();
            });
        });
    </script>
    <script type="text/javascript">
            $(document).ready(function () {
                $("#SaveDoc").click(function (e) {
                    if ($('#DOCUMENT_PATH').val() == "") {
                        alert("Please upload file");
                        return false;
                    }
                    else if ($('#DOCUMENT_TYPE_ID').val() == "") {
                        alert("Please enter Document Type");
                        $('#DOCUMENT_TYPE_ID').focus();
                        return false;
                    }



                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("UploadFile")', // we are calling json method
                        dataType: 'json',
                        data: { docpath: $("#DOCUMENT_PATH").val(), doctype: $("#DOCUMENT_TYPE_ID").val(), regno: $("#REGISTRATION_NO").val() },
                        success: function (data) {
                            data = $.parseJSON(data);
                            var row = "";
                            row += "<tr><th>ID</th><th>Document Type</th><th>Document</th><th></th></tr>"
                            $.each(data, function (index, item) {
                                row += "<tr><td>" + item.ID + "</td><td>" + item.DOC_TYPE + "</td><td>" + item.FILENAME + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                            });
                            $("#tbldoc").html(row);

                            $("#DOCUMENT_TYPE_ID").val('');
                            $("#DOCUMENT_PATH").val('');
                        },
                        error: function (ex) {

                        }
                    });
                    return false;
                });
            });

    </script>

    @*Delete Doc*@
    <script type="text/javascript">
            $(document).ready(function () {
                $("#tbldoc").on("click", ".lnkDelete", function (e) {
                    var href = $(this).context.href;
                    var docid = href.substr(href.indexOf("/") + 35)

                    var answer = confirm("Are you sure you want to delete this record?");
                    if (answer) {

                        $.ajax({
                            type: 'POST',
                            url: '@Url.Action("DeleteDocDetails")', // we are calling json method
                            dataType: 'json',
                            data: { docid: docid },
                            success: function (data) {
                                data = $.parseJSON(data);
                                var row = "";
                                row += "<tr><th>ID</th><th>Document Type</th><th>Document</th><th></th></tr>"
                                $.each(data, function (index, item) {
                                    row += "<tr><td>" + item.ID + "</td><td>" + item.DOC_TYPE + "</td><td>" + item.FILENAME + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                                });
                                $("#tbldoc").html(row);

                                $("#DOCUMENT_TYPE_ID").val('');
                                $("#DOCUMENT_PATH").val('');
                            },
                            error: function (ex) {
                            }
                        });
                        return false;
                    }
                    else {
                        return false;
                    }
                });
            });
    </script>


    @*Number event*@
    <script type="text/javascript">
        function isNumberKey(evt) {

            var charCode = (evt.which) ? evt.which : event.keyCode

            if (charCode > 31 && (charCode < 48 || charCode > 57))

                return false;

            return true;

        }
    </script>

    @*Date picker*@
    <script type="text/javascript">
        $(document).ready(function () {
            $('#DATE_OF_BIRTH').datepicker({
                format: "dd/mm/yyyy",
                endDate: '-1d',
                autoclose: true
            });

            $('#DATE_OF_ISSUE').datepicker({
                format: "dd/mm/yyyy",
                autoclose: true
            });
            5
            $('#EXPIRY_DATE').datepicker({
                format: "dd/mm/yyyy",
                autoclose: true
            });

            $('#DRIVING_DATE_OF_ISSUE').datepicker({
                format: "dd/mm/yyyy",
                autoclose: true
            });

            $('#DRIVING_EXPIRY_DATE').datepicker({
                format: "dd/mm/yyyy",
                autoclose: true
            });

            $('.input-daterange').datepicker({
                todayBtn: "linked",
                format: "dd/mm/yyyy",
                autoclose: true
            });
        });
    </script>

    @*Smart Wizard*@
    <script type="text/javascript">
        $(document).ready(function () {
            $('#wizard').smartWizard({
                //onLeaveStep: leaveAStepCallback,
                //onFinish: onFinishCallback
            });

            function leaveAStepCallback(obj, context) {
                //alert("Leaving step " + context.fromStep + " to go to step " + context.toStep);
                return validateTab(context.fromStep); // return false to stay on step and true to continue navigation
            }

            function onFinishCallback(objs, context) {
                //if(validateAllSteps()){

                $('#formControl').submit();
                //}
            }
        });
    </script>

    @*State Binding with Country Code*@
    <script type="text/javascript">
            $(document).ready(function () {
                //Dropdownlist Selectedchange event
                $("#COUNTRY_CODE").change(function () {
                    $("#STATE_CODE").empty();
                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("GetStateByCountryCode")', // we are calling json method
                        dataType: 'json',
                        data: { Country_code: $("#COUNTRY_CODE").val() },
                        success: function (states) {
                            $("#STATE_CODE").append('<option value="0">--Select State--</option>');
                            // states contains the JSON formatted list
                            // of states passed from the controller
                            $.each(states, function (i, state) {
                                $("#STATE_CODE").append('<option value="' + state.Value + '">' + state.Text + '</option>');
                            }); // here we are adding option for States
                        },
                        error: function (ex) {
                            $("#STATE_CODE").append('<option value="0">--Select State--</option>');
                        }
                    });
                    return false;
                })
            });
    </script>

    @*City Binding with State Code*@
    <script type="text/javascript">
            $(document).ready(function () {
                //Dropdownlist Selectedchange event
                $("#STATE_CODE").change(function () {
                    $("#CITY_CODE").empty();
                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("GetCityByStateCode")', // we are calling json method
                        dataType: 'json',
                        data: { State_code: $("#STATE_CODE").val() },
                        success: function (states) {
                            $("#CITY_CODE").append('<option value="0">--Select City--</option>');
                            // states contains the JSON formatted list
                            // of states passed from the controller
                            $.each(states, function (i, state) {
                                $("#CITY_CODE").append('<option value="' + state.Value + '">' + state.Text + '</option>');
                            }); // here we are adding option for States
                        },
                        error: function (ex) {
                            $("#CITY_CODE").append('<option value="0">--Select City--</option>');
                        }
                    });
                    return false;
                })
            });
    </script>

    @*State Binding with Country Code*@
    <script type="text/javascript">
            $(document).ready(function () {
                //Dropdownlist Selectedchange event
                $("#WORK_EXP_COUNTRY_CODE").change(function () {
                    $("#WORK_EXP_STATE_CODE").empty();
                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("GetStateByCountryCode")', // we are calling json method
                        dataType: 'json',
                        data: { Country_code: $("#WORK_EXP_COUNTRY_CODE").val() },
                        success: function (states) {
                            $("#WORK_EXP_STATE_CODE").append('<option value="0">--Select State--</option>');
                            // states contains the JSON formatted list
                            // of states passed from the controller
                            $.each(states, function (i, state) {
                                $("#WORK_EXP_STATE_CODE").append('<option value="' + state.Value + '">' + state.Text + '</option>');
                            }); // here we are adding option for States
                        },
                        error: function (ex) {
                            $("#WORK_EXP_STATE_CODE").append('<option value="0">--Select State--</option>');
                        }
                    });
                    return false;
                })
            });
    </script>

    @*City Binding with State Code*@
    <script type="text/javascript">
            $(document).ready(function () {
                //Dropdownlist Selectedchange event
                $("#WORK_EXP_STATE_CODE").change(function () {
                    $("#WORK_EXP_CITY_CODE").empty();
                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("GetCityByStateCode")', // we are calling json method
                        dataType: 'json',
                        data: { State_code: $("#WORK_EXP_STATE_CODE").val() },
                        success: function (states) {
                            $("#WORK_EXP_CITY_CODE").append('<option value="0">--Select City--</option>');
                            // states contains the JSON formatted list
                            // of states passed from the controller
                            $.each(states, function (i, state) {
                                $("#WORK_EXP_CITY_CODE").append('<option value="' + state.Value + '">' + state.Text + '</option>');
                            }); // here we are adding option for States
                        },
                        error: function (ex) {
                            $("#WORK_EXP_CITY_CODE").append('<option value="0">--Select City--</option>');
                        }
                    });
                    return false;
                })
            });
    </script>

    @*Save Address*@
    <script type="text/javascript">
            $(document).ready(function () {

                $("#SaveAddress").click(function (e) {
                    var ADDRESS_TYPE_ID = $("#ADDRESS_TYPE_ID").val();
                    var ADDRESS = $("#ADDRESS").val();
                    var COUNTRY_CODE = $("#COUNTRY_CODE").val();
                    var STATE_CODE = $("#STATE_CODE").val();
                    var CITY_CODE = $("#CITY_CODE").val();
                    var VILLAGE = $("#VILLAGE").val();
                    var PIN_CODE = $("#PIN_CODE").val();

                    if (ADDRESS_TYPE_ID == "") {
                        alert("Please select Address Type");
                        $("#ADDRESS_TYPE_ID").focus();
                        return false;
                    }
                    if (ADDRESS == "") {
                        alert("Please enter Address");
                        $("#ADDRESS").focus();
                        return false;
                    }

                    if (COUNTRY_CODE == "") {
                        alert("Please select Country");
                        $("#COUNTRY_CODE").focus();
                        return false;
                    }

                    if (STATE_CODE == "") {
                        alert("Please select State");
                        $("#STATE_CODE").focus();
                        return false;
                    }
                    if (CITY_CODE == "") {
                        alert("Please select City");
                        $("#CITY_CODE").focus();
                        return false;
                    }

                    if (PIN_CODE == "") {
                        alert("Please enter Pincode");
                        $("#PIN_CODE").focus();
                        return false;
                    }

                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("SaveAddressDetails")', // we are calling json method
                        dataType: 'json',
                        data: { address_type: $("#ADDRESS_TYPE_ID").val(), address: $("#ADDRESS").val(), citycode: $("#CITY_CODE").val(), pincode: $("#PIN_CODE").val(), village: $("#VILLAGE").val(), regno: $("#REGISTRATION_NO").val() },
                        success: function (data) {
                            data = $.parseJSON(data);
                            var row = "";
                            row += "<tr><th>ID</th><th>Address</th><th>Country</th><th>StateCity</th><th>Village</th><th>Pincode</th><th></th></tr>"
                            $.each(data, function (index, item) {
                                row += "<tr><td>" + item.ID + "</td><td>" + item.Address + "</td><td>" + item.Country + "</td><td>" + item.StateCity + "</td><td>" + item.Village + "</td><td>" + item.Pin_Code + "</td> <td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                            });
                            $("#tblchild").html(row);

                            $("#PIN_CODE").val('');
                            $("#VILLAGE").val('');
                            $("#ADDRESS").val('');
                            $("#ADDRESS_TYPE_ID").val('0');
                            $("#Country_Code").val('0');
                            $("#State_Code").val('0');
                            $("#City_Code").val('0');
                        },
                        error: function (ex) {

                        }
                    });
                    return false;
                });
            });
    </script>

    @*Delete Addess*@
    <script type="text/javascript">
            $(document).ready(function () {
                $("#tblchild").on("click", ".lnkDelete", function (e) {
                    var href = $(this).context.href;
                    var addressid = href.substr(href.indexOf("/") + 35)

                    var answer = confirm("Are you sure you want to delete this record?");
                    if (answer) {

                        $.ajax({
                            type: 'POST',
                            url: '@Url.Action("DeleteAddressDetails")', // we are calling json method
                            dataType: 'json',
                            data: { addressid: addressid },
                            success: function (data) {
                                data = $.parseJSON(data);
                                var row = "";
                                row += "<tr><th>ID</th><th>Address</th><th>Country</th><th>StateCity</th><th>Village</th><th>Pincode</th><th></th></tr>"
                                $.each(data, function (index, item) {
                                    row += "<tr><td>" + item.ID + "</td><td>" + item.Address + "</td><td>" + item.Country + "</td><td>" + item.StateCity + "</td><td>" + item.Village + "</td><td>" + item.Pin_Code + "</td> <td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                                });
                                $("#tblchild").html(row);

                                $("#PIN_CODE").val('');
                                $("#VILLAGE").val('');
                                $("#ADDRESS").val('');
                                $("#ADDRESS_TYPE_ID").val('0');
                                $("#Country_Code").val('0');
                                $("#State_Code").val('0');
                                $("#City_Code").val('0');
                            },
                            error: function (ex) {
                            }
                        });
                        return false;
                    }
                    else {
                        return false;
                    }
                });
            });
    </script>

    @*Save Email*@
    <script type="text/javascript">
            $(document).ready(function () {

                $("#SaveEmail").click(function (e) {
                    var EMAIL_ID = $("#EMAIL_ID").val();

                    if (EMAIL_ID == "") {
                        alert("Please enter Email_ID");
                        $("#EMAIL_ID").focus();
                        return false;
                    }

                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("SaveEmailDetails")', // we are calling json method
                        dataType: 'json',
                        data: { EmailId: $("#EMAIL_ID").val() },
                        success: function (data) {
                            data = $.parseJSON(data);
                            var row = "";
                            row += "<tr><th>ID</th><th>Email_ID</th><th></th></tr>"
                            $.each(data, function (index, item) {
                                row += "<tr><td>" + item.ID + "</td><td>" + item.EMAIL_ID + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                            });
                            $("#tblemail").html(row);

                            $("#EMAIL_ID").val('');
                        },
                        error: function (ex) {

                        }
                    });
                    return false;
                });
            });
    </script>

    @*Delete Email*@
    <script type="text/javascript">
            $(document).ready(function () {
                $("#tblemail").on("click", ".lnkDelete", function (e) {
                    var href = $(this).context.href;
                    var emailid = href.substr(href.indexOf("/") + 35)

                    var answer = confirm("Are you sure you want to delete this record?");
                    if (answer) {

                        $.ajax({
                            type: 'POST',
                            url: '@Url.Action("DeleteEmailDetails")', // we are calling json method
                            dataType: 'json',
                            data: { emailid: emailid },
                            success: function (data) {
                                data = $.parseJSON(data);
                                var row = "";
                                row += "<tr><th>ID</th><th>Email_ID</th><th></th></tr>"
                                $.each(data, function (index, item) {
                                    row += "<tr><td>" + item.ID + "</td><td>" + item.EMAIL_ID + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                                });
                                $("#tblemail").html(row);

                                $("#EMAIL_ID").val('');
                            },
                            error: function (ex) {
                            }
                        });
                        return false;
                    }
                    else {
                        return false;
                    }
                });
            });
    </script>

    @*Save Phone*@
    <script type="text/javascript">
            $(document).ready(function () {

                $("#SavePhone").click(function (e) {
                    var PHONE_TYPE_ID = $("#PHONE_TYPE_ID").val();
                    var PHONE_NO = $("#PHONE_NO").val();

                    if (PHONE_TYPE_ID == "") {
                        alert("Please select Phone Type");
                        $("#PHONE_TYPE_ID").focus();
                        return false;
                    }

                    if (PHONE_NO == "") {
                        alert("Please enter Phone No");
                        $("#PHONE_NO").focus();
                        return false;
                    }

                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("SavePhoneDetails")', // we are calling json method
                        dataType: 'json',
                        data: { PHONE_NO: PHONE_NO, PHONE_TYPE_ID: PHONE_TYPE_ID },
                        success: function (data) {
                            data = $.parseJSON(data);
                            var row = "";
                            row += "<tr><th>ID</th><th>PhoneNo</th><th></th></tr>"
                            $.each(data, function (index, item) {
                                row += "<tr><td>" + item.ID + "</td><td>" + item.PHONE_NO + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                            });
                            $("#tblphone").html(row);

                            $("#PHONE_NO").val('');
                        },
                        error: function (ex) {

                        }
                    });
                    return false;
                });
            });
    </script>

    @*Delete Phone*@
    <script type="text/javascript">
            $(document).ready(function () {
                $("#tblphone").on("click", ".lnkDelete", function (e) {
                    var href = $(this).context.href;
                    var phoneid = href.substr(href.indexOf("/") + 35)

                    var answer = confirm("Are you sure you want to delete this record?");
                    if (answer) {

                        $.ajax({
                            type: 'POST',
                            url: '@Url.Action("DeletePhoneDetails")', // we are calling json method
                            dataType: 'json',
                            data: { phoneid: phoneid },
                            success: function (data) {
                                data = $.parseJSON(data);
                                var row = "";
                                row += "<tr><th>ID</th><th>PhoneNo</th><th></th></tr>"
                                $.each(data, function (index, item) {
                                    row += "<tr><td>" + item.ID + "</td><td>" + item.PHONE_NO + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                                });
                                $("#tblphone").html(row);

                                $("#PHONE_NO").val('');
                            },
                            error: function (ex) {
                            }
                        });
                        return false;
                    }
                    else {
                        return false;
                    }
                });
            });
    </script>

    @*Save Certification*@
    <script type="text/javascript">
            $(document).ready(function () {

                $("#SaveCertification").click(function (e) {
                    var CERTIFICATION = $("#CERTIFICATION").val();
                    var CERTIFICATION_LEVEL = $("#CERTIFICATION_LEVEL").val();
                    var INSTITUTE_NAME = $("#INSTITUTE_NAME").val();
                    var INSTITUE_YEAR_OF_PASSING = $("#INSTITUE_YEAR_OF_PASSIN").val();

                    if (CERTIFICATION == "") {
                        alert("Please enter Certification");
                        $("#CERTIFICATION").focus();
                        return false;
                    }

                    if (CERTIFICATION_LEVEL == "") {
                        alert("Please enter Ceritification Level");
                        $("#CERTIFICATION_LEVEL").focus();
                        return false;
                    }
                    if (INSTITUTE_NAME == "") {
                        alert("Please enter Institute Name");
                        $("#INSTITUTE_NAME").focus();
                        return false;
                    }

                    if (INSTITUE_YEAR_OF_PASSING == "") {
                        alert("Please enter Year of Passing");
                        $("#INSTITUE_YEAR_OF_PASSIN").focus();
                        return false;
                    }

                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("SaveCertificationDetails")', // we are calling json method
                        dataType: 'json',
                        data: { CERTIFICATION: CERTIFICATION, CERTIFICATION_LEVEL: CERTIFICATION_LEVEL, INSTITUTE_NAME: INSTITUTE_NAME, INSTITUE_YEAR_OF_PASSING: INSTITUE_YEAR_OF_PASSING },
                        success: function (data) {
                            data = $.parseJSON(data);
                            var row = "";
                            row += "<tr><th>ID</th><th>Certification</th><th>Certification Level</th><th>Institute</th><th>Year of Passing</th><th></th></tr>"
                            $.each(data, function (index, item) {
                                row += "<tr><td>" + item.ID + "</td><td>" + item.CERTIFICATION + "</td><td>" + item.CERTIFICATION_LEVEL + "</td><td>" + item.INSTITUTE_NAME + "</td><td>" + item.INSTITUE_YEAR_OF_PASSING + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                            });
                            $("#tblcertification").html(row);

                            $("#CERTIFICATION").val('');
                            $("#CERTIFICATION_LEVEL").val('');
                            $("#INSTITUTE_NAME").val('');
                            $("#INSTITUE_YEAR_OF_PASSIN").val('');

                        },
                        error: function (ex) {

                        }
                    });
                    return false;
                });
            });
    </script>

    @*Delete Certification*@
    <script type="text/javascript">
            $(document).ready(function () {
                $("#tblcertification").on("click", ".lnkDelete", function (e) {
                    var href = $(this).context.href;
                    var certificationid = href.substr(href.indexOf("/") + 35)

                    var answer = confirm("Are you sure you want to delete this record?");
                    if (answer) {

                        $.ajax({
                            type: 'POST',
                            url: '@Url.Action("DeleteCertificationDetails")', // we are calling json method
                            dataType: 'json',
                            data: { certificationid: certificationid },
                            success: function (data) {
                                data = $.parseJSON(data);
                                var row = "";
                                row += "<tr><th>ID</th><th>Certification</th><th>Certification Level</th><th>Institute</th><th>Year of Passing</th><th></th></tr>"
                                $.each(data, function (index, item) {
                                    row += "<tr><td>" + item.ID + "</td><td>" + item.CERTIFICATION + "</td><td>" + item.CERTIFICATION_LEVEL + "</td><td>" + item.INSTITUTE_NAME + "</td><td>" + item.INSTITUE_YEAR_OF_PASSING + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                                });
                                $("#tblcertification").html(row);

                                $("#CERTIFICATION").val('');
                                $("#CERTIFICATION_LEVEL").val('');
                                $("#INSTITUTE_NAME").val('');
                                $("#INSTITUE_YEAR_OF_PASSIN").val('');
                            },
                            error: function (ex) {
                            }
                        });
                        return false;
                    }
                    else {
                        return false;
                    }
                });
            });
    </script>

    @*Save Education*@
    <script type="text/javascript">
            $(document).ready(function () {

                $("#SaveEducation").click(function (e) {
                    var EDUCATION_TYPE_ID = $("#EDUCATION_TYPE_ID").val();
                    var SPECIALIZATION_TYPE_ID = $("#SPECIALIZATION_TYPE_ID").val();
                    var UNIVERSITY_ID = $("#UNIVERSITY_ID").val();
                    var UNIVERSITY_YEAR_OF_PASSING = $("#UNIVERSITY_YEAR_OF_PASSING").val();

                    if (EDUCATION_TYPE_ID == "") {
                        alert("Please select Education Type");
                        $("#EDUCATION_TYPE_ID").focus();
                        return false;
                    }

                    if (SPECIALIZATION_TYPE_ID == "") {
                        alert("Please select Specialization Type");
                        $("#SPECIALIZATION_TYPE_ID").focus();
                        return false;
                    }
                    if (UNIVERSITY_ID == "") {
                        alert("Please select University");
                        $("#UNIVERSITY_ID").focus();
                        return false;
                    }

                    if (UNIVERSITY_YEAR_OF_PASSING == "") {
                        alert("Please enter Year of Passing");
                        $("#UNIVERSITY_YEAR_OF_PASSING").focus();
                        return false;
                    }

                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("SaveEducationDetails")', // we are calling json method
                        dataType: 'json',
                        data: { EDUCATION_TYPE_ID: EDUCATION_TYPE_ID, SPECIALIZATION_TYPE_ID: SPECIALIZATION_TYPE_ID, UNIVERSITY_ID: UNIVERSITY_ID, UNIVERSITY_YEAR_OF_PASSING: UNIVERSITY_YEAR_OF_PASSING },
                        success: function (data) {
                            data = $.parseJSON(data);
                            var row = "";
                            row += "<tr><th>ID</th><th>Education</th><th>Specialization</th><th>University</th><th>Year of Passing</th><th></th></tr>"
                            $.each(data, function (index, item) {
                                row += "<tr><td>" + item.ID + "</td><td>" + item.EDUCATION_TYPE + "</td><td>" + item.SPECIALIZATION_TYPE + "</td><td>" + item.UNIVERSITY + "</td><td>" + item.UNIVERSITY_YEAR_OF_PASSING + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                            });
                            $("#tbleducation").html(row);

                            $("#EDUCATION_TYPE_ID").val('');
                            $("#SPECIALIZATION_TYPE_ID").val('');
                            $("#UNIVERSITY_ID").val('');
                            $("#UNIVERSITY_YEAR_OF_PASSING").val('');

                        },
                        error: function (ex) {

                        }
                    });
                    return false;
                });
            });
    </script>

    @*Delete Certification*@
    <script type="text/javascript">
            $(document).ready(function () {
                $("#tbleducation").on("click", ".lnkDelete", function (e) {
                    var href = $(this).context.href;
                    var educationid = href.substr(href.indexOf("/") + 35)

                    var answer = confirm("Are you sure you want to delete this record?");
                    if (answer) {

                        $.ajax({
                            type: 'POST',
                            url: '@Url.Action("DeleteEducationDetails")', // we are calling json method
                            dataType: 'json',
                            data: { educationid: educationid },
                            success: function (data) {
                                data = $.parseJSON(data);
                                var row = "";
                                row += "<tr><th>ID</th><th>Education</th><th>Specialization</th><th>University</th><th>Year of Passing</th><th></th></tr>"
                                $.each(data, function (index, item) {
                                    row += "<tr><td>" + item.ID + "</td><td>" + item.EDUCATION_TYPE + "</td><td>" + item.SPECIALIZATION_TYPE + "</td><td>" + item.UNIVERSITY + "</td><td>" + item.UNIVERSITY_YEAR_OF_PASSING + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                                });
                                $("#tbleducation").html(row);

                                $("#EDUCATION_TYPE_ID").val('');
                                $("#SPECIALIZATION_TYPE_ID").val('');
                                $("#UNIVERSITY_ID").val('');
                                $("#UNIVERSITY_YEAR_OF_PASSING").val('');
                            },
                            error: function (ex) {
                            }
                        });
                        return false;
                    }
                    else {
                        return false;
                    }
                });
            });
    </script>

    @*Save Work*@
    <script type="text/javascript">
            $(document).ready(function () {

                $("#SaveWork").click(function (e) {
                    var USER_COMPANY_NAME = $("#USER_COMPANY_NAME").val();
                    var DESIGNATION_ID = $("#DESIGNATION_ID").val();
                    var INDUSTRY_ID = $("#INDUSTRY_ID").val();
                    var WORK_PERIOD_FROM = $("#WORK_PERIOD_FROM").val();
                    var WORK_PERIOD_TO = $("#WORK_PERIOD_TO").val();
                    var WORK_EXP_CITY_CODE = $("#WORK_EXP_CITY_CODE").val();

                    var IS_EXPERIENCED = $('input[name=careerstatus]:checked').val();
                    var IS_CURRENT_STATUS = $('input[name=currentlyworking]:checked').val();

                    if (IS_EXPERIENCED == "experience") {
                        if (USER_COMPANY_NAME == "") {
                            alert("Please select Company");
                            $("#USER_COMPANY_NAME").focus();
                            return false;
                        }

                        if (DESIGNATION_ID == "") {
                            alert("Please select Designation");
                            $("#DESIGNATION_ID").focus();
                            return false;
                        }

                        if (INDUSTRY_ID == "") {
                            alert("Please select Industry");
                            $("#INDUSTRY_ID").focus();
                            return false;
                        }

                        if (WORK_PERIOD_FROM == "") {
                            alert("Please enter Work Period From");
                            $("#WORK_PERIOD_FROM").focus();
                            return false;
                        }

                        if (WORK_PERIOD_TO == "") {
                            alert("Please enter Work Period To");
                            $("#WORK_PERIOD_TO").focus();
                            return false;
                        }
                    }
                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("SaveWorkDetails")', // we are calling json method
                        dataType: 'json',
                        data: { IS_EXPERIENCED: IS_EXPERIENCED, IS_CURRENT_STATUS: IS_CURRENT_STATUS, USER_COMPANY_NAME: USER_COMPANY_NAME, DESIGNATION_ID: DESIGNATION_ID, INDUSTRY_ID: INDUSTRY_ID, WORK_PERIOD_FROM: WORK_PERIOD_FROM, WORK_PERIOD_TO: WORK_PERIOD_TO, WORK_EXP_CITY_CODE: WORK_EXP_CITY_CODE },
                        success: function (data) {
                            data = $.parseJSON(data);
                            var row = "";
                            row += "<tr><th>ID</th><th>Company</th><th>Designation</th><th>Industry</th><th>Work Period</th><th>Career Status</th><th>Currently Working</th><th></th></tr>"
                            $.each(data, function (index, item) {
                                row += "<tr><td>" + item.ID + "</td><td>" + item.COMPANY + "</td><td>" + item.DESIGNATION + "</td><td>" + item.INDUSTRY + "</td><td>" + item.WORK_PERIOD + "</td><td>" + item.IS_EXPERIENCED + "</td><td>" + item.IS_CURRENT_STATUS + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                            });
                            $("#tblwork").html(row);

                            $("#USER_COMPANY_NAME").val('');
                            $("#DESIGNATION_ID").val('');
                            $("#INDUSTRY_ID").val('');
                            $("#WORK_PERIOD_FROM").val('');
                            $("#WORK_PERIOD_TO").val('');
                            $("#WORK_EXP_CITY_CODE").val('');
                            $("#WORK_EXP_STATE_CODE").val('');
                            $("#WORK_EXP_COUNTRY_CODE").val('');
                        },
                        error: function (ex) {

                        }
                    });
                    return false;
                });
            });
    </script>

    @*Delete Work*@
    <script type="text/javascript">
            $(document).ready(function () {
                $("#tblwork").on("click", ".lnkDelete", function (e) {
                    var href = $(this).context.href;
                    var workid = href.substr(href.indexOf("/") + 35)

                    var answer = confirm("Are you sure you want to delete this record?");
                    if (answer) {

                        $.ajax({
                            type: 'POST',
                            url: '@Url.Action("DeleteWorkDetails")', // we are calling json method
                            dataType: 'json',
                            data: { workid: workid },
                            success: function (data) {
                                data = $.parseJSON(data);
                                var row = "";
                                row += "<tr><th>ID</th><th>Company</th><th>Designation</th><th>Industry</th><th>Work Period</th><th>Current Status</th><th></th></tr>"
                                $.each(data, function (index, item) {
                                    row += "<tr><td>" + item.ID + "</td><td>" + item.USER_COMPANY_NAME + "</td><td>" + item.DESIGNATION + "</td><td>" + item.INDUSTRY + "</td><td>" + item.WORK_PERIOD_FORM + " - " + item.WORK_PERIOD_TO + "</td><td>" + item.CURRENT_STATUS + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                                });
                                $("#tblwork").html(row);

                                $("#USER_COMPANY_NAME").val('');
                                $("#DESIGNATION_ID").val('');
                                $("#INDUSTRY_ID").val('');
                                $("#WORK_PERIOD_FROM").val('');
                                $("#WORK_PERIOD_TO").val('');
                                $("#WORK_EXP_CITY_CODE").val('');
                                $("#WORK_EXP_STATE_CODE").val('');
                                $("#WORK_EXP_COUNTRY_CODE").val('');
                            },
                            error: function (ex) {
                            }
                        });
                        return false;
                    }
                    else {
                        return false;
                    }
                });
            });
    </script>

    @*Save Language*@
    <script type="text/javascript">
            $(document).ready(function () {

                $("#SaveLanguage").click(function (e) {
                    debugger;
                    var LANGUAGE_ID = $("#LANGUAGE_ID").val();

                    var IS_READ = $('#IS_READ').prop('checked');
                    var IS_WRITE = $('#IS_WRITE').prop('checked');
                    var IS_SPEAK = $("#IS_SPEAK").prop('checked');

                    if (LANGUAGE_ID == "") {
                        alert("Please select Language");
                        $("#LANGUAGE_ID").focus();
                        return false;
                    }

                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("SaveLanguageDetails")', // we are calling json method
                        dataType: 'json',
                        data: { LANGUAGE_ID: LANGUAGE_ID, IS_READ: IS_READ, IS_WRITE: IS_WRITE, IS_SPEAK: IS_SPEAK },
                        success: function (data) {
                            data = $.parseJSON(data);
                            var row = "";
                            row += "<tr><th>ID</th><th>Language</th><th>Read</th><th>Write</th><th>Speak</th><th></th></tr>"
                            $.each(data, function (index, item) {
                                row += "<tr><td>" + item.ID + "</td><td>" + item.LANGUAGE + "</td><td>" + item.IS_READ + "</td><td>" + item.IS_WRITE + "</td><td>" + item.IS_SPEAK + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                            });
                            $("#tbllanguage").html(row);

                            $("#LANGUAGE_ID").val('');
                            $("#IS_READ").prop('checked', false);
                            $("#IS_WRITE").prop('checked', false);
                            $("#IS_SPEAK").prop('checked', false);
                        },
                        error: function (ex) {

                        }
                    });
                    return false;
                });
            });
    </script>

    @*Delete Language*@
    <script type="text/javascript">
            $(document).ready(function () {
                $("#tbllanguage").on("click", ".lnkDelete", function (e) {
                    var href = $(this).context.href;
                    var languageid = href.substr(href.indexOf("/") + 35)

                    var answer = confirm("Are you sure you want to delete this record?");
                    if (answer) {

                        $.ajax({
                            type: 'POST',
                            url: '@Url.Action("DeleteLanguageDetails")', // we are calling json method
                            dataType: 'json',
                            data: { languageid: languageid },
                            success: function (data) {
                                data = $.parseJSON(data);
                                var row = "";
                                row += "<tr><th>ID</th><th>Language</th><th>Read</th><th>Write</th><th>Speak</th><th></th></tr>"
                                $.each(data, function (index, item) {
                                    row += "<tr><td>" + item.ID + "</td><td>" + item.LANGUAGE + "</td><td>" + item.IS_READ + "</td><td>" + item.IS_WRITE + "</td><td>" + item.IS_SPEAK + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                                });
                                $("#tbllanguage").html(row);

                                $("#LANGUAGE_ID").val('');
                            },
                            error: function (ex) {
                            }
                        });
                        return false;
                    }
                    else {
                        return false;
                    }
                });
            });
    </script>

<script type="text/javascript">

    $(document).ready(function () {

        //$(".select_industry").multiselect({
        //    maxHeight: 200,
        //    includeSelectAllOption: true,
        //    enableCaseInsensitiveFiltering: true
        //});

        //$(".select_company").select2({
        //    placeholder: "Select Company",
        //    allowClear: true
        //});

        //$(".select_designation").select2({
        //    placeholder: "Select Designation",
        //    allowClear: true
        //});

        //$(".select_city").select2({
        //    placeholder: "Select City",
        //    allowClear: true
        //});

        //$(".select_country").select2({
        //    placeholder: "Select Country",
        //    allowClear: true
        //});

        //$(".select_state").select2({
        //    placeholder: "Select State",
        //    allowClear: true
        //});

        //$(".select_village").select2({
        //    placeholder: "Select Village",
        //    allowClear: true
        //});


        //$('#candidateForm2').find('[name="dateReceived"]').mask('99/99/9999')

        //$(".select_visaNo").select2({
        //    placeholder: "Select Visa No",
        //    allowClear: true
        //});

        //$(".select_nationality").select2({
        //    placeholder: "Select Nationality",
        //    allowClear: true
        //});

        //$(".select_location").select2({
        //    placeholder: "Select Location",
        //    allowClear: true
        //});

        //$(".select_religion").select2({
        //    placeholder: "Select Religion",
        //    allowClear: true
        //});

        $('#candidateForm1')
          .bootstrapValidator({
              excluded: ':disabled',
              message: 'This value is not valid',
              feedbackIcons: {
                  valid: 'glyphicon glyphicon-ok',
                  invalid: 'glyphicon glyphicon-remove',
                  validating: 'glyphicon glyphicon-refresh'
              },
              fields: {
                  selectType: {
                      validators: {
                          notEmpty: {
                              message: 'The type is required'
                          }
                      }
                  },
                  source: {
                      validators: {
                          notEmpty: {
                              message: 'The source is required'
                          }
                      }
                  },
                  selectStatus: {
                      validators: {
                          notEmpty: {
                              message: 'The status is required'
                          }
                      }
                  },
                  requirement: {
                      validators: {
                          notEmpty: {
                              message: 'The requirement is required'
                          }
                      }
                  }
              }
          });

        $('#candidateForm2')
       .bootstrapValidator({
           excluded: ':disabled',
           message: 'This value is not valid',
           feedbackIcons: {
               valid: 'glyphicon glyphicon-ok',
               invalid: 'glyphicon glyphicon-remove',
               validating: 'glyphicon glyphicon-refresh'
           },
           fields: {
               firstname: {
                   validators: {
                       notEmpty: {
                           message: 'The first name is required'
                       }
                   }
               },
               lastName: {
                   validators: {
                       notEmpty: {
                           message: 'The last name is required'
                       }
                   }
               },
               nationality: {
                   validators: {
                       notEmpty: {
                           message: 'The nationality is required'
                       }
                   }
               },
               location: {
                   validators: {
                       notEmpty: {
                           message: 'The location is required'
                       }
                   }
               },
               religion: {
                   validators: {
                       notEmpty: {
                           message: 'The religion is required'
                       }
                   }
               },
               dateReceived: {
                   validators: {
                       notEmpty: {
                           message: 'The date of birth is required'
                       },
                       callback: {
                           message: 'The date is not valid',
                           callback: function (value, validator) {

                               var validformat = /^\d{2}\/\d{2}\/\d{4}$/ //Basic check for format validity
                               if (!validformat.test(value)) {
                                   return false;
                               }
                               var date = new Date(),
                               today = dateString = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear().toString();

                               function parseDate(str) {
                                   var d = str.split("/");
                                   return d[2] + d[0] + d[1];
                               }

                               if (parseDate(value) > parseDate(today)) {
                                   return false
                               }
                               return true;
                           }
                       }
                   }
               }
           }
       });


        $('#candidateForm3')
   .bootstrapValidator({
       excluded: ':disabled',
       message: 'This value is not valid',
       feedbackIcons: {
           valid: 'glyphicon glyphicon-ok',
           invalid: 'glyphicon glyphicon-remove',
           validating: 'glyphicon glyphicon-refresh'
       },
       fields: {
           address: {
               validators: {
                   notEmpty: {
                       message: 'The address is required'
                   }
               }
           },
           country: {
               validators: {
                   notEmpty: {
                       message: 'The country is required'
                   }
               }
           },
           state: {
               validators: {
                   notEmpty: {
                       message: 'The state is required'
                   }
               }
           },
           city: {
               validators: {
                   notEmpty: {
                       message: 'The city is required'
                   }
               }
           },
           phoneNumber: {
               validators: {
                   notEmpty: {
                       message: 'The phone is required'
                   }
               }
           }
       }
   });


        $('#candidateForm4')
       .bootstrapValidator({
           excluded: ':disabled',
           message: 'This value is not valid',
           feedbackIcons: {
               valid: 'glyphicon glyphicon-ok',
               invalid: 'glyphicon glyphicon-remove',
               validating: 'glyphicon glyphicon-refresh'
           },
           fields: {
               epassing: {
                   validators: {
                       callback: {
                           message: 'Year passing is not valid',
                           callback: function (value, validator) {
                               var date = new Date(),
                               today = dateString = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear().toString();

                               function parseDate(str) {
                                   var d = str.split("/");
                                   return d[2];
                               }
                               console.log(parseDate(today))
                               if (value > parseDate(today)) {
                                   return false
                               }
                               return true;
                           }
                       }
                   }
               },
               cpassing: {
                   validators: {
                       callback: {
                           message: 'Year passing is not valid',
                           callback: function (value, validator) {
                               var date = new Date(),
                               today = dateString = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear().toString();

                               function parseDate(str) {
                                   var d = str.split("/");
                                   return d[2];
                               }
                               console.log(parseDate(today))
                               if (value > parseDate(today)) {
                                   console.log('soju');
                                   return false
                               }
                               return true;
                           }
                       }
                   }
               }
           }
       });


        // $('#candidateForm5')
        //        .bootstrapValidator({
        //         excluded: ':disabled',
        //         message: 'This value is not valid',
        //         feedbackIcons: {
        //             valid: 'glyphicon glyphicon-ok',
        //             invalid: 'glyphicon glyphicon-remove',
        //             validating: 'glyphicon glyphicon-refresh'
        //         },
        //         fields: {
        //             fromdate: {
        //                 validators: {
        //                     between: {
        //                         max: 'todate',
        //                         message: 'The number of floors must be between 2 and 100'
        //                     }
        //                 }
        //             }
        //         }
        //     });

    });
</script>

<script type="text/javascript">


    function validateTab(index) {
        // return true;
        if (index == 4 || index == 5 || index == 6) {
            return true;
        }
        var fv = $('#candidateForm' + index).data('bootstrapValidator'); // FormValidation instance

        // Validate the container
        fv.validate();
        //console.log(fv.validate($tab))
        var isValidStep = fv.isValid();
        console.log(isValidStep)
        if (isValidStep === false || isValidStep === null) {
            // Do not jump to the target tab
            return false;
        }

        return true;
    }


</script>

    @*
    <script type="text/javascript">
        $(document).on('change', 'input[name="careerstatus"]:radio', function () {
            if ($(this).val() == 'fresher') {
                $(".career").addClass('hide');
                $("#optionCompanyTemplate").addClass('hide');
            } else {
                $(".career").removeClass('hide');
            }
        });
        $(document).ready(function () {

            //$(".select_industry").multiselect({
            //    maxHeight: 200,
            //    includeSelectAllOption: true,
            //    enableCaseInsensitiveFiltering: true
            //});

            //$(".select_company").select2({
            //    placeholder: "Select Company",
            //    allowClear: true
            //});

            //$(".select_designation").select2({
            //    placeholder: "Select Designation",
            //    allowClear: true
            //});

            //$(".select_city").select2({
            //    placeholder: "Select City",
            //    allowClear: true
            //});

            //$(".select_country").select2({
            //    placeholder: "Select Country",
            //    allowClear: true
            //});

            //$(".select_state").select2({
            //    placeholder: "Select State",
            //    allowClear: true
            //});

            //$(".select_village").select2({
            //    placeholder: "Select Village",
            //    allowClear: true
            //});


            //$('#candidateForm2').find('[name="dateReceived"]').mask('99/99/9999')

            //$(".select_visaNo").select2({
            //    placeholder: "Select Visa No",
            //    allowClear: true
            //});

            //$(".select_nationality").select2({
            //    placeholder: "Select Nationality",
            //    allowClear: true
            //});

            //$(".select_location").select2({
            //    placeholder: "Select Location",
            //    allowClear: true
            //});

            //$(".select_religion").select2({
            //    placeholder: "Select Religion",
            //    allowClear: true
            //});

            $('#candidateForm1')
              .bootstrapValidator({
                  excluded: ':disabled',
                  message: 'This value is not valid',
                  feedbackIcons: {
                      valid: 'glyphicon glyphicon-ok',
                      invalid: 'glyphicon glyphicon-remove',
                      validating: 'glyphicon glyphicon-refresh'
                  },
                  fields: {
                      selectType: {
                          validators: {
                              notEmpty: {
                                  message: 'The type is required'
                              }
                          }
                      },
                      source: {
                          validators: {
                              notEmpty: {
                                  message: 'The source is required'
                              }
                          }
                      },
                      selectStatus: {
                          validators: {
                              notEmpty: {
                                  message: 'The status is required'
                              }
                          }
                      },
                      requirement: {
                          validators: {
                              notEmpty: {
                                  message: 'The requirement is required'
                              }
                          }
                      }
                  }
              });

            $('#candidateForm2')
           .bootstrapValidator({
               excluded: ':disabled',
               message: 'This value is not valid',
               feedbackIcons: {
                   valid: 'glyphicon glyphicon-ok',
                   invalid: 'glyphicon glyphicon-remove',
                   validating: 'glyphicon glyphicon-refresh'
               },
               fields: {
                   firstname: {
                       validators: {
                           notEmpty: {
                               message: 'The first name is required'
                           }
                       }
                   },
                   lastName: {
                       validators: {
                           notEmpty: {
                               message: 'The last name is required'
                           }
                       }
                   },
                   nationality: {
                       validators: {
                           notEmpty: {
                               message: 'The nationality is required'
                           }
                       }
                   },
                   location: {
                       validators: {
                           notEmpty: {
                               message: 'The location is required'
                           }
                       }
                   },
                   religion: {
                       validators: {
                           notEmpty: {
                               message: 'The religion is required'
                           }
                       }
                   },
                   dateReceived: {
                       validators: {
                           notEmpty: {
                               message: 'The date of birth is required'
                           },
                           callback: {
                               message: 'The date is not valid',
                               callback: function (value, validator) {

                                   var validformat = /^\d{2}\/\d{2}\/\d{4}$/ //Basic check for format validity
                                   if (!validformat.test(value)) {
                                       return false;
                                   }
                                   var date = new Date(),
                                   today = dateString = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear().toString();

                                   function parseDate(str) {
                                       var d = str.split("/");
                                       return d[2] + d[0] + d[1];
                                   }

                                   if (parseDate(value) > parseDate(today)) {
                                       return false
                                   }
                                   return true;
                               }
                           }
                       }
                   }
               }
           });


            $('#candidateForm3')
       .bootstrapValidator({
           excluded: ':disabled',
           message: 'This value is not valid',
           feedbackIcons: {
               valid: 'glyphicon glyphicon-ok',
               invalid: 'glyphicon glyphicon-remove',
               validating: 'glyphicon glyphicon-refresh'
           },
           fields: {
               address: {
                   validators: {
                       notEmpty: {
                           message: 'The address is required'
                       }
                   }
               },
               country: {
                   validators: {
                       notEmpty: {
                           message: 'The country is required'
                       }
                   }
               },
               state: {
                   validators: {
                       notEmpty: {
                           message: 'The state is required'
                       }
                   }
               },
               city: {
                   validators: {
                       notEmpty: {
                           message: 'The city is required'
                       }
                   }
               },
               phoneNumber: {
                   validators: {
                       notEmpty: {
                           message: 'The phone is required'
                       }
                   }
               }
           }
       });


            $('#candidateForm4')
           .bootstrapValidator({
               excluded: ':disabled',
               message: 'This value is not valid',
               feedbackIcons: {
                   valid: 'glyphicon glyphicon-ok',
                   invalid: 'glyphicon glyphicon-remove',
                   validating: 'glyphicon glyphicon-refresh'
               },
               fields: {
                   epassing: {
                       validators: {
                           callback: {
                               message: 'Year passing is not valid',
                               callback: function (value, validator) {
                                   var date = new Date(),
                                   today = dateString = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear().toString();

                                   function parseDate(str) {
                                       var d = str.split("/");
                                       return d[2];
                                   }
                                   console.log(parseDate(today))
                                   if (value > parseDate(today)) {
                                       return false
                                   }
                                   return true;
                               }
                           }
                       }
                   },
                   cpassing: {
                       validators: {
                           callback: {
                               message: 'Year passing is not valid',
                               callback: function (value, validator) {
                                   var date = new Date(),
                                   today = dateString = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear().toString();

                                   function parseDate(str) {
                                       var d = str.split("/");
                                       return d[2];
                                   }
                                   console.log(parseDate(today))
                                   if (value > parseDate(today)) {
                                       console.log('soju');
                                       return false
                                   }
                                   return true;
                               }
                           }
                       }
                   }
               }
           });


            // $('#candidateForm5')
            //        .bootstrapValidator({
            //         excluded: ':disabled',
            //         message: 'This value is not valid',
            //         feedbackIcons: {
            //             valid: 'glyphicon glyphicon-ok',
            //             invalid: 'glyphicon glyphicon-remove',
            //             validating: 'glyphicon glyphicon-refresh'
            //         },
            //         fields: {
            //             fromdate: {
            //                 validators: {
            //                     between: {
            //                         max: 'todate',
            //                         message: 'The number of floors must be between 2 and 100'
            //                     }
            //                 }
            //             }
            //         }
            //     });

            $('#candidateForm3').find('[name="phoneNumber"]').mask('(099)-099-0990')
                            .find('[name="addphoneNumber"]').mask('(099)-099-0990');


            $('#candidateForm3').find('[name="epassing"]').mask('9999');

            $('#candidateForm3')
       .on('click', '.addAddress', function () {
           var $template = $('#optionAddressTemplate'),
               $clone = $template
                               .clone()
                               .removeClass('hide')
                               .removeAttr('id')
                               .insertBefore($template),
               $option = $clone.find('[name="option[]"]');


           // Add new field
           //$('#candidateForm1').formValidation('addField', $option);
       })

       // Remove button click handler
       .on('click', '.removeButton', function () {
           var $row = $(this).parents('.groupAddress'),
               $option = $row.find('[name="option[]"]');

           // Remove element containing the option
           $row.remove();

           // Remove field
           // $('#surveyForm').formValidation('removeField', $option);
       });

            $('#candidateForm3')
            .on('click', '.addEmailButton', function () {
                var $template = $('#optionEmailTemplate'),
                    $clone = $template
                                    .clone()
                                    .removeClass('hide')
                                    .removeAttr('id')
                                    .insertBefore($template),
                    $option = $clone.find('[name="option[]"]');

                // Add new field
                //$('#contactForm').formValidation('addField', $option);
            })

            // Remove button click handler
            .on('click', '.removeButton', function () {
                var $row = $(this).parents('#optionEmailTemplate'),
                    $option = $row.find('[name="option[]"]');

                // Remove element containing the option
                $row.remove();

                // Remove field
                // $('#surveyForm').formValidation('removeField', $option);
            });

            // The maximum number of options
            var MAX_OPTIONS = 5;

            $('#candidateForm3')
                .on('click', '.addPhoneButton', function () {
                    var $template = $('#optionPhoneTemplate'),
                        $clone = $template
                                        .clone()
                                        .removeClass('hide')
                                        .removeAttr('id')
                                        .insertBefore($template),
                        $option = $clone.find('[name="option[]"]');

                    // Add new field
                    //$('#candidateForm1').formValidation('addField', $option);
                })

                // Remove button click handler
                .on('click', '.removeButton', function () {
                    var $row = $(this).parents('.form-group'),
                        $option = $row.find('[name="option[]"]');

                    // Remove element containing the option
                    $row.remove();

                    // Remove field
                    // $('#surveyForm').formValidation('removeField', $option);
                })

                // Called after adding new field
                .on('added.field.fv', function (e, data) {
                    // data.field   --> The field name
                    // data.element --> The new field element
                    // data.options --> The new field options

                    if (data.field === 'option[]') {
                        if ($('#candidateForm3').find(':visible[name="option[]"]').length >= MAX_OPTIONS) {
                            $('#candidateForm3').find('.addPhoneButton').attr('disabled', 'disabled');
                        }
                    }
                })

                // Called after removing the field
                .on('removed.field.fv', function (e, data) {
                    if (data.field === 'option[]') {
                        if ($('#candidateForm3').find(':visible[name="option[]"]').length < MAX_OPTIONS) {
                            $('#candidateForm3').find('.addPhoneButton').removeAttr('disabled');
                        }
                    }
                });





            function validateTab(index) {
                // return true;
                if (index == 4 || index == 5 || index == 6) {
                    return true;
                }
                var fv = $('#candidateForm' + index).data('bootstrapValidator'); // FormValidation instance

                // Validate the container
                fv.validate();
                //console.log(fv.validate($tab))
                var isValidStep = fv.isValid();
                console.log(isValidStep)
                if (isValidStep === false || isValidStep === null) {
                    // Do not jump to the target tab
                    return false;
                }

                return true;
            }

            $('#candidateForm3')
               .on('click', '.addAddress', function () {
                   var $template = $('#optionAddressTemplate'),
                       $clone = $template
                                       .clone()
                                       .removeClass('hide')
                                       .removeAttr('id')
                                       .insertBefore($template),
                       $option = $clone.find('[name="option[]"]');
                   $(":input").inputmask();

                   // Add new field
                   //$('#candidateForm1').formValidation('addField', $option);
               })

               // Remove button click handler
               .on('click', '.removeButton', function () {
                   var $row = $(this).parents('.groupAddress'),
                       $option = $row.find('[name="option[]"]');

                   // Remove element containing the option
                   $row.remove();

                   // Remove field
                   // $('#surveyForm').formValidation('removeField', $option);
               });

            $('#candidateForm6')
            .on('click', '.addDocuments', function () {
                var $template = $('#optionDocumentsTemplate'),
                    $clone = $template
                                    .clone()
                                    .removeClass('hide')
                                    .removeAttr('id')
                                    .insertBefore($template),
                    $option = $clone.find('[name="option[]"]');
                $(":input").inputmask();

                // Add new field
                //$('#candidateForm1').formValidation('addField', $option);
            })

            // Remove button click handler
            .on('click', '.removeButton', function () {
                var $row = $(this).parents('.groupDocuments'),
                    $option = $row.find('[name="option[]"]');

                // Remove element containing the option
                $row.remove();

                // Remove field
                // $('#surveyForm').formValidation('removeField', $option);
            });

            $('#candidateForm5')
            .on('click', '.addCompany', function () {
                var $template = $('#optionCompanyTemplate'),
                    $clone = $template
                                    .clone()
                                    .removeClass('hide')
                                    .removeAttr('id')
                                    .insertBefore($template),
                    $option = $clone.find('[name="option[]"]');

                $("#select_company1").select2({
                    placeholder: "Select Company",
                    allowClear: true
                });

                $("#select_designation1").select2({
                    placeholder: "Select Designation",
                    allowClear: true
                });

                $("#select_city1").select2({
                    placeholder: "Select City",
                    allowClear: true
                });

                $("#select_country1").select2({
                    placeholder: "Select Country",
                    allowClear: true
                });

                $(".select_state1").select2({
                    placeholder: "Select State",
                    allowClear: true
                });



                // Add new field
                //$('#candidateForm1').formValidation('addField', $option);
            })

            // Remove button click handler
            .on('click', '.removeButton', function () {
                var $row = $(this).parents('.groupCompany'),
                    $option = $row.find('[name="option[]"]');

                // Remove element containing the option
                $row.remove();

                // Remove field
                // $('#surveyForm').formValidation('removeField', $option);
            });

            $('#candidateForm4')
            .on('click', '.addCertification', function () {
                var $template = $('#optionCertificationTemplate'),
                    $clone = $template
                                    .clone()
                                    .removeClass('hide')
                                    .removeAttr('id')
                                    .insertBefore($template),
                    $option = $clone.find('[name="option[]"]');
                var countriesArray = $.map(countries, function (value, key) {
                    return {
                        value: value,
                        data: key
                    };
                });
                // Initialize autocomplete with custom appendTo:
                $('.auto-custom1').autocomplete({
                    lookup: countriesArray,
                    appendTo: '#autocomplete-container1'
                });

                // Add new field
                //$('#candidateForm1').formValidation('addField', $option);
            })

            // Remove button click handler
            .on('click', '.removeButton', function () {
                var $row = $(this).parents('.groupCertification'),
                    $option = $row.find('[name="option[]"]');

                // Remove element containing the option
                $row.remove();

                // Remove field
                // $('#surveyForm').formValidation('removeField', $option);
            });
            // The maximum number of options
            var MAX_OPTIONS = 5;

            $('#candidateForm3')
                .on('click', '.addPhoneButton', function () {
                    var $template = $('#optionPhoneTemplate'),
                        $clone = $template
                                        .clone()
                                        .removeClass('hide')
                                        .removeAttr('id')
                                        .insertBefore($template),
                        $option = $clone.find('[name="option[]"]');
                    $(":input").inputmask();

                    // Add new field
                    //$('#candidateForm1').formValidation('addField', $option);
                })

                // Remove button click handler
                .on('click', '.removeButton', function () {
                    var $row = $(this).parents('.form-group'),
                        $option = $row.find('[name="option[]"]');

                    // Remove element containing the option
                    $row.remove();

                    // Remove field
                    // $('#surveyForm').formValidation('removeField', $option);
                })

                // Called after adding new field
                .on('added.field.fv', function (e, data) {
                    // data.field   --> The field name
                    // data.element --> The new field element
                    // data.options --> The new field options

                    if (data.field === 'option[]') {
                        if ($('#candidateForm3').find(':visible[name="option[]"]').length >= MAX_OPTIONS) {
                            $('#candidateForm3').find('.addPhoneButton').attr('disabled', 'disabled');
                        }
                    }
                })

                // Called after removing the field
                .on('removed.field.fv', function (e, data) {
                    if (data.field === 'option[]') {
                        if ($('#candidateForm3').find(':visible[name="option[]"]').length < MAX_OPTIONS) {
                            $('#candidateForm3').find('.addPhoneButton').removeAttr('disabled');
                        }
                    }
                });

            $('#candidateForm1')
            .find('.select_requirement').select2({
                placeholder: "Select Requirement",
                allowClear: true
            });


        });

        $(document).ready(function () {
            var oTable = $('#languageTable').dataTable({
                "oLanguage": {
                    "sSearch": "Search all columns:"
                },
                "aoColumnDefs": [
                    {
                        'bSortable': false,
                        'aTargets': [0, 2, 3, 4, 5]
                    } //disables sorting for column one
                ],
                'iDisplayLength': 4,
                "aLengthMenu": [4, 6],
                "sPaginationType": "full_numbers",
                "dom": 'T<"clear">lfrtip',
                "tableTools": {
                    "sSwfPath": "<?php echo base_url('assets2/js/Datatables/tools/swf/copy_csv_xls_pdf.swf'); ?>"
                }
            });
            $("tfoot input").keyup(function () {
                /* Filter on the column based on the index of this element's parent <th> */
                oTable.fnFilter(this.value, $("tfoot th").index($(this).parent()));
            });
            $("tfoot input").each(function (i) {
                asInitVals[i] = this.value;
            });
            $("tfoot input").focus(function () {
                if (this.className == "search_init") {
                    this.className = "";
                    this.value = "";
                }
            });
            $("tfoot input").blur(function (i) {
                if (this.value == "") {
                    this.className = "search_init";
                    this.value = asInitVals[$("tfoot input").index(this)];
                }
            });

            $("#languageTable_wrapper .DTTT_container").hide();
            $(".submitLanguages").click(function () {
                var cells = [];
                var rows = $("#languageTable").dataTable().fnGetNodes();

                for (var i = 0; i < rows.length; i++) {
                    // Get HTML of 3rd column (for example)
                    cells.push($(rows[i]).find("td:eq(2)").find("input[type='checkbox']").attr("name"), $(rows[i]).find("td:eq(2)").find("input[type='checkbox']").is(":checked"), $(rows[i]).find("td:eq(3)").find("input[type='checkbox']").is(":checked"), $(rows[i]).find("td:eq(4)").find("input[type='checkbox']").is(":checked"));
                }
                var i, j, temparray, chunk = 4, html = "";
                for (i = 0, j = cells.length; i < j; i += chunk) {
                    temparray = cells.slice(i, i + chunk);
                    // do whatever
                    if (temparray[1] || temparray[2] || temparray[3]) {
                        var readValue, writeValue, speakValue;
                        if (temparray[1]) {
                            readValue = "Y"
                        } else {
                            readValue = "N"
                        }
                        ;
                        if (temparray[2]) {
                            writeValue = "Y"
                        } else {
                            writeValue = "N"
                        }
                        ;
                        if (temparray[3]) {
                            speakValue = "Y"
                        } else {
                            speakValue = "N"
                        }
                        ;
                        html += "<tr><td>" + temparray[0] + "</td><td><span class='languageVal'>" + readValue + "</span></td><td><span class='languageVal'>" + writeValue + "</span></td><td><span class='languageVal'>" + speakValue + "</span></td><td><a class='editLanguage'>Edit</a> | <a class='deleteLanguage'>Delete</a></td></tr>";
                    }
                }
                $("#languageResult tbody").html(html);
                $("#languageResult").removeClass("hidden");

            });

            $("#languageResult").delegate(".deleteLanguage", "click", function () {
                $(this).closest("tr").remove();
            });

            $("#languageResult").delegate(".editLanguage", "click", function () {
                var readVal = $(this).closest("tr").find("td:eq(1)").text();
                var writeVal = $(this).closest("tr").find("td:eq(2)").text();
                var speakVal = $(this).closest("tr").find("td:eq(3)").text();

                if (readVal == "Y") {
                    $(this).closest("tr").find("td:eq(1)").append("<input type='checkbox' checked /></td>");
                } else {
                    $(this).closest("tr").find("td:eq(1)").append("<input type='checkbox' /></td>");
                }

                if (writeVal == "Y") {
                    $(this).closest("tr").find("td:eq(2)").append("<input type='checkbox' checked /></td>");
                } else {
                    $(this).closest("tr").find("td:eq(2)").append("<input type='checkbox' /></td>");
                }

                if (speakVal == "Y") {
                    $(this).closest("tr").find("td:eq(3)").append("<input type='checkbox' checked /></td>");
                } else {
                    $(this).closest("tr").find("td:eq(3)").append("<input type='checkbox' /></td>");
                }

                $(this).next(".deleteLanguage").addClass("cancelLanguage").removeClass("deleteLanguage").text("Cancel");
                $(this).addClass("updateLanguage").removeClass("editLanguage").text("Update");
                $(this).closest("tr").find("span.languageVal").hide();

            });

            $("#languageResult").delegate(".updateLanguage", "click", function () {
                for (i = 1; i <= 3; i++) {
                    if ($(this).closest("tr").find("td:eq(" + i + ")").find("input[type='checkbox']").is(":checked")) {
                        $(this).closest("tr").find("td:eq(" + i + ")").find("span").text("Y").show();
                    } else {
                        $(this).closest("tr").find("td:eq(" + i + ")").find("span").text("N").show();
                    }
                    $(this).closest("tr").find("td:eq(" + i + ")").find("input[type='checkbox']").remove();
                }
                $(this).next(".cancelLanguage").addClass("deleteLanguage").removeClass("cancelLanguage").text("Delete");
                $(this).addClass("editLanguage").removeClass("updateLanguage").text("Edit");
            });

            $("#languageResult").delegate(".cancelLanguage", "click", function () {
                for (i = 1; i <= 3; i++) {
                    $(this).closest("tr").find("td:eq(" + i + ")").find("input[type='checkbox']").remove();
                }
                $(this).closest("tr").find("span.languageVal").show();
                $(this).prev(".updateLanguage").addClass("editLanguage").removeClass("updateLanguage").text("Edit");
                $(this).addClass("deleteLanguage").removeClass("cancelLanguage").text("Delete");
            });
        });

    </script>*@

    <!-- Autocomplete -->
    @*
    <script type="text/javascript" src="~/js/autocomplete/countries.js"></script>
    <script src="~/js/autocomplete/jquery.autocomplete.js"></script>*@
    <!-- daterangepicker -->
    @*
    <script type="text/javascript" src="~/js/moment.min2.js"></script>
    <script type="text/javascript" src="~/js/datepicker/daterangepicker.js"></script>
    <script type="text/javascript" src="~/js/parsley/parsley.min.js"></script>*@
    @*
    <script type="text/javascript">

        $('#fromdate').daterangepicker({
            singleDatePicker: true,
            calender_style: "picker_4"
        }, function (start, end, label) {
            console.log(start.toISOString(), end.toISOString(), label);
        });

        $('#todate').daterangepicker({
            singleDatePicker: true,
            calender_style: "picker_4"
        }, function (start, end, label) {
            console.log(start.toISOString(), end.toISOString(), label);
        });

        $(function () {
            'use strict';
            var countriesArray = $.map(countries, function (value, key) {
                return {
                    value: value,
                    data: key
                };
            });
            // Initialize autocomplete with custom appendTo:
            $('#autocomplete-custom-append').autocomplete({
                lookup: countriesArray,
                appendTo: '#autocomplete-container'
            });
            // Initialize autocomplete with custom appendTo:
            $('.document-custom').autocomplete({
                lookup: countriesArray,
                appendTo: '#document-container'
            });
        });
    </script>*@



